import request from '@/utils/request'

// 收货地址列表
export function getAddressList(params) {
  return request({
    url: '/UserApi/addressList',
    method: 'get',
    params
  })
}

// 添加收货地址
export function addAddress(data) {
  return request({
    url: '/UserApi/addAddress',
    method: 'post',
    data
  })
}

// 编辑收货地址
export function editAddress(data) {
  return request({
    url: '/UserApi/editAddress',
    method: 'post',
    data
  })
}

// 删除收货地址
export function delAddress(data) {
  return request({
    url: '/UserApi/delAddress',
    method: 'post',
    data
  })
}

// 设为默认地址
export function setDefaultAddress(data) {
  return request({
    url: '/UserApi/setDefaultAddress',
    method: 'post',
    data
  })
}
// 获取乡镇地址
export function getAddressTown(data) {
  return request({
    url: '/UserApi/getStreet',
    method: 'post',
    data
  })
}
// 地址自动识别
export function discernAddress(data) {
  return request({
    url: '/UserApi/discernAddress',
    method: 'post',
    data
  })
}

// 根据地址获取省市区id
export function getAddressIdInfo(params) {
  return request({
    url: '/PublicApi/getAddressIdInfo',
    method: 'get',
    params
  })
}
// 微信地址获取
export function sysncrWxAddress(data) {
  return request({
    url: '/UserApi/sysncrWxAddress',
    method: 'post',
    data
  })
}

// 获取签名
export function webServiceApiSign(params) {
  return request({
    url: '/OrderApi/webServiceApiSign',
    method: 'get',
    params
  })
}
